import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    name: 'layout',
      redirect: '/banner',
    component:  () => import('@/Layout/index.vue'),
    children: [
        {
            path: '/banner',
            name: 'banner',
            component:  () => import('@/views/banner/index.vue'),
        },
        {
            path: '/banner/save/:id?',
            name: 'bannerSave',
            component:  () => import('@/views/banner/save.vue'),
        },
        {
            path: '/news',
            name: 'news',
            component:  () => import('@/views/news/index.vue'),
        },
        {
            path: '/news/Save/:id?',
            name: 'newsSave',
            component:  () => import('@/views/news/save.vue'),
        },
        {
            path: '/user',
            name: 'user',
            component:  () => import('@/views/user/index.vue'),
        },
        {
            path: '/user/save/:id?',
            name: 'userSave',
            component:  () => import('@/views/user/save.vue'),
        },
        {
            path: '/color',
            name: 'color',
            component:  () => import('@/views/color/index.vue'),
        },
        {
            path: '/color/Save/:id?',
            name: 'colorSave',
            component:  () => import('@/views/color/save.vue'),
        },
        {
            path: '/consult',
            name: 'consult',
            component:  () => import('@/views/consult/index.vue'),
        },
        {
            path: '/consult/save/:id?',
            name: 'consultSave',
            component:  () => import('@/views/consult/save.vue'),
        },
        {
            path: '/diagnosis',
            name: 'diagnosis',
            component:  () => import('@/views/diagnosis/index.vue'),
        }
    ]
  },
    {
        path: '/login',
        name: 'login',
        component:  () => import('@/views/Login.vue'),
    }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
